/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2013/02/17
* File: random.cpp
* Blog: http://www.cnblogs.com/zengqh/
**/

#include "enn_random.h"

namespace enn
{
static unsigned randomSeed = 1;

void SetRandomSeed(unsigned seed)
{
	randomSeed = seed;
}

unsigned GetRandomSeed()
{
	return randomSeed;
}

int Rand()
{
	randomSeed = randomSeed * 214013 + 2531011;
	return (randomSeed >> 16) & 32767;
}
}